/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #f4f4f4;
}

/* 容器样式，用于包裹整个页面内容，设置合适宽度并居中 */
.container {
  width: 80%;
  margin: 0 auto;
}

/* 页面头部样式 */
.header {
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown {
  display: inline-block;
  margin-right: 20px;
}

.dropdown select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.button {
  background-color: #007BFF;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 3px;
  cursor: pointer;
}

.button:hover {
  background-color: #0056b3;
}

/* 侧边栏样式，固定在左侧，设置宽度、背景等，添加过渡效果用于鼠标悬停时背景色变化更平滑，使用 transform 使其垂直居中 */
.sidebar {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 200px;
  background-color: #333;
  color: #fff;
  padding: 20px;
  transition: background-color 0.3s ease;
}

.sidebar:hover {
  background-color: #555;
}

.sidebar ul {
  list-style-type: none;
  padding: 0;
}

.sidebar li {
  padding: 10px 0;
  cursor: pointer;
}

.sidebar li:hover {
  background-color: #777;
}

/* 主体内容区域样式，设置左边距避开侧边栏，添加内边距，使用 flex 布局实现自适应，同时设置最小高度保证“关于我”和“联系我们”能在底部合理显示 */
.main-content {
  margin-left: 200px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 60px);
}

/* 通用文章样式，统一外观，添加阴影、背景等 */
.article {
  background-color: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  width: 100%;
  max-width: 800px;
  position: relative;
}

.article h2 {
  margin-top: 0;
  color: #007BFF;
}

.article p {
  color: #555;
}

.article-details {
  margin-top: 10px;
  display: none;
}

/* 通用按钮样式 */
button {
  background-color: #007BFF;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 3px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

.like-button {
  margin-top: 10px;
}

.like-count {
  margin-left: 5px;
  font-weight: bold;
}

/* 评论区域样式 */
.comment-section {
  margin-top: 15px;
  border-top: 1px solid #ccc;
  padding-top: 10px;
}

.comment-section h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.comment {
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 3px;
  margin-bottom: 10px;
  position: relative;
}

.comment p {
  margin: 0;
  color: #333;
}

.comment button {
  background-color: #dc3545;
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 5px 10px;
  font-size: 14px;
}

/* 新增文章表单样式 */
.add-article-form {
  background-color: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  padding: 15px;
  border-radius: 5px;
  width: 100%;
  max-width: 800px;
  margin-top: 20px;
  display: none;
  flex-direction: column;
  align-items: flex-start;
}

.add-article-form label {
  margin-bottom: 5px;
  display: block;
  font-weight: bold;
  color: #333;
}

.add-article-form input[type="text"],
.add-article-form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-bottom: 15px;
}

.add-article-form button[type="submit"] {
  background-color: #28a745;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 3px;
  cursor: pointer;
}

.add-article-form button[type="submit"]:hover {
  background-color: #218838;
}

/* 删除文章按钮样式 */
.delete-article-button {
  background-color: #dc3545;
  position: absolute;
  top: 5px;
  right: 50px;
  padding: 5px 10px;
  font-size: 14px;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.delete-article-button:hover {
  background-color: #c82333;
}

/* 评论输入框样式 */
.comment-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-bottom: 10px;
}

/* “关于我”与“联系我们”通用内容区域样式 */
.info-section {
  margin-top: 20px;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}

.info-section h2 {
  margin-bottom: 10px;
}

.info-section p {
  color: #555;
}

.info-section ul {
  list-style-type: none;
  padding-left: 20px;
  margin-top: 10px;
}